package com.dmz.etc.task.config;

import com.dmz.common.utils.secure.GMUtil;
import com.zaxxer.hikari.HikariDataSource;

/**
 * @author lee
 */
public class MyHikariDataSource extends HikariDataSource {

    private String key = EnvConfig.getProperty("sm4.key");

    private String iv = EnvConfig.getProperty("sm4.iv");

    @Override
    public String getUsername() {
        // 对用户名进行解密
        return GMUtil.db(key, iv, super.getUsername());
    }

    @Override
    public String getPassword() {
        // 对密码进行解密
        return GMUtil.db(key, iv, super.getPassword());
    }
}
